﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OrmAuto;

public partial class Controls_DettagliAuto : System.Web.UI.UserControl
{
    protected string mIdMesssaggio = string.Empty;
    protected string mUrlMessaggio = string.Empty; 
 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString != null)
            showDetails();

        Response.Flush();
    }//fM

    private void showDetails()
    {
        //if (IsPostBack) return; 
        string idStr = Request.QueryString["id"];
        if (string.IsNullOrEmpty(idStr)) return;
        mIdMesssaggio = idStr;

        mUrlMessaggio = "./ContattiAnnuncio.aspx?id=" + mIdMesssaggio;

        int id = 0;
        int.TryParse (idStr,out id);

        var q = new OrmAuto.QuerierAnnunciSql();
        var annVendita = q.get_vAnnVenditaCompleta(id);
        if (annVendita == null) return;

        
        this.FormView1.DataSource = annVendita ;
        this.FormView1.DataMember = "ANNVendita";
        this.FormView1.DataBind();

    }//fM


   
}//fC
